#Makefile
CC=g++ -Wall -g

target=BSTreeTest maxSubArray  findMinKNumberTest  BinaryHeapTest fibTest sortTest

lib = utils.o
.PHONY: $(target) 
all:$(target)

sortTest:sortTest.o include/dataList.h
	$(CC) $^ -o   $@
fibTest:fibonacci.o include/SeqStack.h
	$(CC) $^ -o   $@
findMinKNumberTest:findMinKNumberTest.o disorderArray.o $(lib)
	${CC} $^ -o   $@
BSTreeTest:BSTreeTest.o BSTree.o BTree.o
	${CC} $^ -o   $@
BinaryHeapTest:BinaryHeapTest.o include/BinaryHeap.h
	${CC} $^ -o   $@
maxSubArray:maxSubArray.o
	${CC} $^ -o   $@
%.o:src/%.cpp include/BinaryHeap.h 
	$(CC) -c $^
%.o:src/%.c
	$(CC) -c $^
%.o:test/%.c
	$(CC) -c $^
%.o:test/%.cpp include/BinaryHeap.h
	$(CC) -c $^
%.o:lib/%.c
	$(CC) -c $^

.PHONY:clean
clean:
	rm -rf *.o
	rm	$(target)
#end
